<nz-table
    #nestedTable
    [nzLoading]='tableLoading'
    [nzScroll]='scrollValue'
    [nzData]='tableData'
    [(nzPageSize)]='searchObj.pageSize'
    [nzTotal]='total'
    [(nzPageIndex)]='searchObj.pageNum'
    [nzShowPagination]='false'
    [nzFrontPagination]='false'
    (nzPageSizeChange)='list()'
    (nzPageIndexChange)='list()'
    nzShowSizeChanger
    nzShowQuickJumper='true'
>
    <thead>
    <tr>
        <th *ngFor='let column of tableColumnMap | keyvalue'>{{ column.value.name }}</th>
        <th nzWidth='170px'>
            <ng-container *ngFor="let optionModel of otherOptionModelList; let i = index"  >
                <ng-container *ngIf='optionModel.optionLabelType == OptionTypeEnum.BUTTON' [ngSwitch]='optionModel.eventKey'>
                    <button nz-button
                            *ngSwitchCase='EventKeyEnum.DELETE'
                            nz-popconfirm
                            nzPopconfirmTitle="确认删除?"
                            (nzOnConfirm)="eventPublish(mainItem,optionModel.eventKey)"
                    >
                        {{optionModel.optionLabel}}
                    </button>
                    <button nz-button
                            *ngSwitchDefault
                            (click)='eventPublish(mainItem,optionModel.eventKey)'
                    >
                        {{optionModel.optionLabel}}
                    </button>
                </ng-container>
            </ng-container>
        </th>
    </tr>
    </thead>
    <tbody [@listAnimation]='tableData'>
    <ng-template ngFor let-item [ngForOf]='tableData'>
        <tr>
            <td *ngFor='let column of tableColumnMap'>
                <span *ngIf='column.type === 1'>{{ item[column.key] }}</span>
                <span *ngIf='column.type === 2'>
                <nz-tag *ngIf='tableCaseMap.get(column.key).get(item[column.key]+"")' [nzColor]='tableCaseMap.get(column.key).get(item[column.key]+"").color'>{{ tableCaseMap.get(column.key).get(item[column.key]+"").tag }}</nz-tag>
                <nz-tag *ngIf='!tableCaseMap.get(column.key).get(item[column.key]+"")' [nzColor]='tableCaseMap.get(column.key).get("other").color'>{{ tableCaseMap.get(column.key).get("other").tag }}</nz-tag>
            </span>
            </td>
            <td *ngIf='optionModelList != null'>
                <ng-container *ngFor="let optionModel  of optionModelList; let i = index"  >
                    <ng-container *ngIf='optionModel.optionLabelType == OptionTypeEnum.TEXT' [ngSwitch]='optionModel.eventKey'>
                        <nz-divider *ngIf='i!=0' nzType="vertical" ></nz-divider>
                        <a *ngSwitchCase='OptionKeyEnum.DELETE'
                           nz-popconfirm
                           nzPopconfirmTitle="确认删除?"
                           (nzOnConfirm)="onDelete(item)"
                        >
                            {{optionModel.optionLabel}}
                        </a>
                        <a  *ngSwitchDefault (click)='eventPublish(item,optionModel.eventKey)'>
                            {{optionModel.optionLabel}}
                        </a>
                    </ng-container>
                    <div *ngIf='optionModel.optionLabelType == OptionTypeEnum.SELECT'>
                        <label  nz-checkbox [(ngModel)]="item.isCheckedButton" (ngModelChange)="checkedButtonChange(item)">
                        </label>
                    </div>
                </ng-container>
            </td>
        </tr>
        </ng-template>
    </tbody>
</nz-table>
